//
//  UITableViewHeaderFooterView+Extend.m
//  JiHe_IOS
//
//  Created by GuoliWang on 2018/8/31.
//  Copyright © 2018年 JiHe. All rights reserved.
//

#import "UITableViewHeaderFooterView+Extend.h"

@implementation UITableViewHeaderFooterView (Extend)

+ (instancetype)headerWithTableView:(UITableView *)tableView{
    NSString * headerId =  NSStringFromClass([self class]);
    
    
    const char * className = [headerId cStringUsingEncoding:NSASCIIStringEncoding];
    
    Class headerFooterViewClass = objc_getClass(className);
    
    UITableViewHeaderFooterView * header = [tableView dequeueReusableHeaderFooterViewWithIdentifier:headerId];
    
    if (!header) {
        header = [[headerFooterViewClass alloc]initWithReuseIdentifier:headerId];

    }
    return header;
}
@end
